import { request } from "@yaf/request";
import {RespDataType } from "./apiType";
import { toApi } from "@/service/proxyApi";

export * from "./apiType";

const {get, del} = request;

/**
 * 获取登录日志分页列表
 */
export const getLoginLogPageList = (params: {page:number, pageSize: number, ipaddr?: string, userName?: string, status?: string,}) => {
    return get<RespDataType.LoginLogPageList>(toApi("api/v1/system/loginLog/list"), params);
}

/**
 * 删除登录日志
 */
export const deleteLoginLog = (infoIdList:number[]) => {
    return del(toApi(`api/v1/system/loginLog/delete?ids=${JSON.stringify(infoIdList)}`));
}

/**
 * 清空登录日志
 */
export const clearLoginLog = () => {
    return del(toApi(`api/v1/system/loginLog/clear`));
}
